-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MU4] fix MU3 issue #323402, accidentals not shown as expected for altered unisons #8772
[MU4] fix MU3 issue #323402, accidentals not shown as expected for altered unisons #8772
Conversation
191c64f
to
114e79a
Compare
src/engraving/libmscore/note.cpp
Outdated
@@ -2354,6 +2363,10 @@ void Note::updateAccidental(AccidentalState* as) | |||
} else if (acci == AccidentalType::NONE) { | |||
acci = AccidentalType::NATURAL; | |||
} | |||
} else if (chordHasAnotherAccidentalForSameNote(this)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
potentially this condition could be just be added to the if
above, but hard to be confident that won't have other consequences
Measure* m = score->firstMeasure(); | ||
Chord* c = m->findChord(Fraction(0, 1), 0); | ||
QVERIFY(c->downNote()->accidental() && c->downNote()->accidental()->accidentalType() == Ms::AccidentalType::FLAT); | ||
QVERIFY(c->upNote()->accidental() && c->upNote()->accidental()->accidentalType() == Ms::AccidentalType::NATURAL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would have preferred to use QCOMPARE however this is crashing for me using MSVC debug C runtime, when it tries to delete
the strings returned by QTest::toString( ). No idea why, it all looks fine stepping through it.
114e79a
to
fb2db95
Compare
int relLine = absStep(note->tpc(), note->epitch()); | ||
return std::find_if(chordNotes.begin(), chordNotes.end(), [note, accVal, relLine](Note* n) { | ||
return n != note && !n->hidden() && absStep(n->tpc(), n->epitch()) == relLine && tpc2alter(n->tpc()) != accVal; | ||
}) != chordNotes.end(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i.e. look for a note on the same A-G step (including octave), but that would require a different accidental.
Does this need somebody else to review/approve @igorkorsukov |
Resolves: https://musescore.org/en/node/323402
Altered unisons where the same note occurs twice in one chord but with different accidentals need to ensure that the accidentals for both notes are always correctly shown (currently they appear and disappear somewhat randomly)